﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Dapper;
using Elight.Entity;
using Elight.Repository.Interfaces;

namespace Elight.Repository
{
    public partial class UserRoleRepository : BaseRepository<Sys_User_Role>, IUserRoleRepository
    {
        public IEnumerable<Sys_User_Role> GetList(int userId)
        {
            using (IDbConnection conn = OpenSharedConnection())
            {
                string sql = @"SELECT * FROM SYS_USER_ROLE t WHERE t.UserId = @UserId";
                return conn.Query<Sys_User_Role>(sql, new { UserId = userId });
            }
        }
    }
}
